define(['jquery'], function ($) {
    function goBack() {
        history.go(-1);
        return false;
    }

    //加载菜单
    function load() {
        $("#menu-container").hide();
        $("#menu-container").load("./article_menu.html", function () {
            bindShowEvent();
            functionButtonBind();
        });
    }

    //绑定显示、隐藏事件
    function bindShowEvent() {

        $("#menu-container").bind('touchend', function (ev) {
            $(this).hide();
            return false;
        });

        $(".swiper-container").bind('touchend', function (ev) {
            $("#menu-container").show();
            return false;
        });
    }

    //解绑显示、隐藏事件
    function unbindShowEvnet() {
        $("#menu-container").unbind();
        $(".swiper-container").unbind();
    }

    //绑定菜单功能按钮
    function functionButtonBind() {
        $(".back-button").bind('touchend', function (ev) {
            return goBack();
        });
    }

    return {
        load: load,
        bindEvent: bindShowEvent,
        unbindEvent: unbindShowEvnet
    }
});